﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JTBox._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.3.6/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.3.6/themes/icon.css" />
    <link rel="Stylesheet" type="text/javascript" href="js/jquery-easyui-1.3.6/demo/demo.css" />
    <script type="text/javascript" src="js/jquery-easyui-1.3.6/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#w').window('close');
            $('#w2').window('close');
            $('#btnlogout').attr('style', 'display:none');

            $.get('Default.aspx', { cmd: 'islogin', id_temp: Math.random() }, function (data) {
                var sJson = eval('(' + data + ')');
                if (sJson['sta'] == 1) {
                    $('#btnlogin').attr('style', 'display:none');
                    $('#btnreg').attr('style', 'display:none');
                    $('#btnlogout').attr('style', "display:''");
                    $('#span_user').empty();
                    $('#span_user').append(sJson['user']);
                }
            })
        });

        function btnclick(i_btn) {
            switch (i_btn) {
                case 1:
                    $('#w').window("open");
                    break;
                case 2:
                    $('#w2').window("open");
                    break;
                case 3:
                    $('#btnlogin').attr('style', "display:''");
                    $('#btnreg').attr('style', "display:''");
                    $('#btnlogout').attr('style', "display:none");
                    $('#span_user').empty();
                    $.get('Default.aspx',{cmd:'logout',id_temp:Math.random()},function (data) {

                    })
                    break;
                case 4:
                    var user = $('#tboxUser').val();
                    var pass = $('#tboxPass').val();
                    $.get('Default.aspx', { cmd: 'login', user: user, pass: pass, id_temp: Math.random() }, function (data) {
                        var sJson = eval('(' + data + ')');
                        if (sJson['sta'] == 1) {
                            $('#w').window('close');
                            $('#btnlogin').attr('style', 'display:none');
                            $('#btnreg').attr('style', 'display:none');
                            $('#btnlogout').attr('style', "display:''");
                            $('#span_user').empty();
                            $('#span_user').append(user);
                            $('#span_info').empty();
                        }
                        else {
                            $('#span_info').empty();
                            $('#span_info').append(sJson['txt']);
                        }
                    });
                    break;
                default:
            }
        }
    </script>
</head>
<body class="easyui-layout">
    <div data-options="region:'north',border:false" style="height: 50px; background: #E0ECFF; padding: 5px">
        <div>jtbox</div>
        <div style="float:right">
            <span id='span_user' style="color:#0000FF"></span>
            <a id="btnlogin" href="#" class="easyui-linkbutton" data-options="plain:true" onclick="btnclick(1)">登录</a>
            <a id="btnreg" href="#" class="easyui-linkbutton" data-options="plain:true" onclick="btnclick(2)">注册</a>
            <a id="btnlogout" href="#" class="easyui-linkbutton" data-options="plain:true" onclick="btnclick(3)">注销</a>
        </div>
    </div>
    <div data-options="region:'west',split:true,title:'菜单'" style="width: 180px; padding: 0px;">
		<div class="easyui-accordion" data-options="fit:true,border:false">
			<div title="常用工具" data-options="selected:true" style="padding:10px;overflow:auto;">
				<p><a href="Forms/PE/PEMain.aspx"  data-options="iconCls:'icon-add'" target="center">PE文件分析</a></p>
				
			</div>
			<div title="其它" style="padding:10px;">
				<p><a href="#"  data-options="iconCls:'icon-add'" target="center"></a></p>
			</div>
		</div>    
        
        
    </div>
    <!--<div data-options="region:'east',split:true,collapsed:true,title:'East'" style="width: 100px;padding: 10px;">east region</div>-->
    <!--<div data-options="region:'south',border:false" style="height: 50px; background: #A9FACD;padding: 10px;">south region</div>-->
    <div data-options="region:'center',title:''" style="overflow: hidden">
        <iframe id="center" name="center" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>
    </div>
	<div id="w" class="easyui-window" data-options="title:'登录',iconCls:'icon-save'" style="width:350px;height:200px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center',border:false" style="padding:10px;background:#fff;border:1px solid #ccc;">
                <table style="width: 100%;">
                    <tr>
                        <td>
                            用户名
                        </td>
                        <td>
                            <input id="tboxUser" type="text" />
                        </td>

                    </tr>
                    <tr>
                        <td>
                            密码
                        </td>
                        <td>
                            <input id="tboxPass" type="password" />
                        </td>

                    </tr>
                    <tr>
                        <td>

                        </td>
                        <td>
                        <span id='span_info' style="color: #FF0000"></span>
                        </td>
                    </tr>
                </table>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="btnclick(4)">确定</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#w').window('close')">取消</a>
			</div>
		</div>
	</div>
	<div id="w2" class="easyui-window" data-options="title:'注册',iconCls:'icon-save'" style="width:400px;height:200px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center',border:false" style="padding:10px;background:#fff;border:1px solid #ccc;">

			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:alert('ok')">确定</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#w2').window('close')">取消</a>
			</div>
		</div>
	</div>       
</body>
</html>
